package com.bawei.module_live.data

import java.io.Serializable
import com.bawei.module_live.data.LiveData

data class LiveRoomData(
    val id: Int,
    val room_id: String?,
    val room_name: String?,
    val room_description: String?,
    val play_url: String?,
    val push_url: String?,
    val create_time: String?,
    val status: Int?,
    val host_id: String?,
    val hot: Int?,
    val follow: Boolean?
): Serializable {
    fun toLiveData(): LiveData = LiveData(
        avatar_url = "", // LiveRoomData 无头像字段
        channelid = "", // 无对应字段
        commentnum = this.hot ?: 0, // 热度作为评论数
        ctime = this.create_time ?: "",
        description = this.room_description ?: "",
        group_id = "", // 无对应字段
        id = this.id,
        image_url = "", // 无对应字段
        item_id = this.room_id ?: "",
        labelIds = "", // 无对应字段
        name = this.room_name ?: "",
        playnum = 0, // 无对应字段
        preview_url = this.play_url ?: "",
        publish_time = this.create_time ?: "",
        title = this.room_name ?: "",
        userid = this.host_id ?: "",
        verifycode = "", // 无对应字段
        videomainimag = "", // 无对应字段
        videopath = this.play_url ?: "",
        room_id = this.room_id?:""
    )
}